<template>
    <risk-people-quotas-common
        bg-color="#ee917f"
        :items="items"
        :data="data"
    ></risk-people-quotas-common>
</template>
<script>
import RiskPeopleQuotasCommon from './risk-people-quotas-common'
import { DEFAULT_QUOTA_CLICK } from './util'

export default {
    name: 'RiskPeopleQuotasSymptom',
    components: {
        RiskPeopleQuotasCommon
    },
    props: {
        data: {
            type: Object,
            default: () => ({})
        }
    },
    computed: {
        symptomOpts () {
            return [
                { label: '发热', value: '1' },
                { label: '干咳', value: '2' },
                { label: '乏力', value: '3' },
                { label: '鼻塞', value: '4' },
                { label: '流涕', value: '5' },
                { label: '咽痛', value: '6' },
                { label: '嗅觉/味觉减退', value: '7' },
                { label: '结膜炎', value: '8' },
                { label: '肌痛', value: '9' },
                { label: '腹泻', value: '10' }
            ]
        },
        items () {
            const maxSymptom = this.symptomOpts.find(item=>item.value == this.data.tenMaxNumKey)
            const maxItem = maxSymptom ? {
                label: maxSymptom.label,
                prop: 'tenMaxNum',
                dataType: 12,
                zzIds: this.data.tenMaxNumKey,
                click: DEFAULT_QUOTA_CLICK.openPeoplePage
            } : null
            return [{
                label: '十大症状总数',
                large: true,
                prop: 'shiDaZongzShuNum',
                dataType: 10,
                click: DEFAULT_QUOTA_CLICK.openReportPage
            }, {
                label: '发热',
                prop: 'faReNum',
                dataType: 11,
                click: DEFAULT_QUOTA_CLICK.openPeoplePage
            }, maxItem, {
                label: '其他',
                prop: 'qiTaZongzNum',
                zzIds: this.data.otherIds,
                dataType: 13,
                click: DEFAULT_QUOTA_CLICK.openPeoplePage
            }].filter(v => v !== null)
        }
    }
}
</script>